using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RangeAttackState : AttackState
{
    protected D_RangeAttackState stateData;

    protected GameObject projectile;

    protected Projectile projectileScript;

    public RangeAttackState(Entity entity, FiniteStateMachine startMachine, string animBoolName, Transform attackPosition,D_RangeAttackState stateData) : base(entity, startMachine, animBoolName, attackPosition)
    {
        this.stateData = stateData;
    }

    public override void DoChecks()
    {
        base.DoChecks();
    }

    public override void Enter()
    {
        base.Enter();
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void FinishAttack()
    {
        base.FinishAttack();
    }

    public override void logicUpdate()
    {
        base.logicUpdate();
    }

    public override void PhysicsUpdate()
    {
        base.PhysicsUpdate();
    }

    public override void TriggerAttack()
    {
        base.TriggerAttack();

        projectile=GameObject.Instantiate(stateData.projectile,attackPosition.position,attackPosition.rotation);
        projectileScript = projectile.GetComponent<Projectile>();
        projectileScript.FireProjectile(stateData.projectileSpeed,stateData.projectileTravelDistance,stateData.projectileDamage);

    }
}
